<?php

class tournament_classes {

	public function __construct(){
		FunctionsHelper::includeFiles(
			array(
				PUBLIC_MODELS_DIRECTORY . 'model.php',
				PUBLIC_MODELS_DIRECTORY . 'tournament_class.php',
			)
		);
	}

	public function getAllClasses(){
		$TournamentClass = new tournament_class();
		return $TournamentClass->getAll();
	}

	public function getOne($class_id){
		$class = new tournament_class(
			array (
				'id' => $class_id
			)
		);
		
		$classSelected = $class->getOne();
		return new tournament_class(
			array (
				'id' => $classSelected[0]['class_id'],
				'description' => $classSelected[0]['description']
			)
		);
	}

	public function getObjectWith($description){
		$TournamentClass = new tournament_class(
			array(
				'id' => $description['id'],
				'active' => 1
			)
		);
		$tournament_class_array = $TournamentClass->getOne();
		$TournamentClass->setDescription($tournament_class_array[0]['description']);
		return $TournamentClass;
	}

}

?>